<include file="common/header" />
<div class="main-container">
    <div class="container">

        <div  class="content user-setting">
            <div class="visible-xs">
                <div class="clearfix mb10 top-title">
                    <h1 class="text-center f18 fb">个人设置</h1>
                    <a href="/user.html" class="btn-user-back">返回个人中心</a>
                </div>
                <div class="row">
                    <ul class="user-left-nav-min">
                        <li class="col-xs-5">
                            <a href="/user/profile.html">资料修改</a>
                        </li>
                        <li class="col-xs-5 col-xs-offset-2">
                            <a href="/user/password.html">密码修改</a>
                        </li>
                    </ul>
                </div>
                <div class="row">
                    <ul class="user-left-nav-min">
                        <li class="col-xs-5">
                            <a href="/user/avatar.html">头像修改</a>
                        </li>
                        <li class="col-xs-5 col-xs-offset-2">
                            <a href="/user/address.html">收件地址管理</a>
                        </li>
                    </ul>
                </div>
                <div class="row">
                    <ul class="user-left-nav-min">
                        <li class="active col-xs-5">
                            <a href="/user/protect.html">手机设置</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="hidden-xs">
                <div class="clearfix mb25 top-title">
                    <h1 class="text-center f18 fb">手机设置</h1>
                    <a href="/user.html" class="ui-btn ui-btn-red ui-btn-mi btn-user-back">返回个人中心</a>
                </div>
            </div>

            <div class="wrap-user-setting row">
                <ul class="user-left-nav col-sm-3 hidden-xs">
                    <li>
                        <a href="/user/profile.html">资料修改</a>
                    </li>
                    <li>
                        <a href="/user/password.html">密码修改</a>
                    </li>
                    <li>
                        <a href="/user/avatar.html">头像修改</a>
                    </li>
                    <li>
                        <a href="/user/address.html">收件地址管理</a>
                    </li>
                    <li class="active">
                        <a href="/user/protect.html">手机设置</a>
                    </li>
                </ul>
                <div class="col-sm-9 col-xs-12">
                    <div class="setting-content">
                            <form class="ui-form" id="phone-change" method="post">
                                <div class="row">
                                    <label class="col-xs-3">旧手机号：</label>
                                    <div class="col-xs-8">
                                        <div class="ipt">
                                            <input  type="text" id="oldphone" value="{$user.mobile}" disabled  style="width: 60%"/>
                                            <input  type="hidden" name="o_mobile" value="{$user.mobile}"  style="width: 60%"/>
                                        </div>
                                    </div>
                                    <div class="col-xs-8 col-xs-offset-3 ptb10">
                                        <a class="ui-btn ui-btn-blue btn-up ml5" id="get-oldcode">获取验证码</a>
                                    </div>
                                    <label class="col-xs-3">手机验证码：</label>
                                    <div class="col-xs-8">
                                        <div class="ipt">
                                            <input name="o_code" type="text"  style="width: 60%"/>
                                        </div>
                                    </div>
                                    <label class="col-xs-3 pt10">新手机号码：</label>
                                    <div class="col-xs-8 pt10">
                                        <div class="ipt">
                                            <input name="mobile" type="text" id="newphone"  style="width: 60%"/>
                                        </div>
                                    </div>
                                    <div class="col-xs-8 col-xs-offset-3 ptb10">
                                        <a class="ui-btn ui-btn-blue btn-up get-newcode ml5">获取验证码</a>
                                    </div>
                                    <label class="col-xs-3">手机验证码：</label>
                                    <div class="col-xs-8">
                                        <div class="ipt">
                                            <input name="code" type="text"  style="width: 60%"/>
                                        </div>
                                    </div>
                                    <div class="col-xs-8 col-xs-offset-3 pt10 pb30">
                                        <a class="ui-btn ui-btn-blue ui-btn-default ml5" id="change-bind">更换绑定</a>
                                    </div>
                                </div>
                            </form>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
        <script>

            $(function(){
                $("#change-bind").on('click',function(){
                    var db =$("#phone-change").serialize();
                    $.post('/user/protect',db,function(data){
                        alert(data.info);
                        if(data.status == 1){
                            window.location.reload();
                        }
                    },'json')
                })
            })
        </script>
<include file="common/footer" />